﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace QLChiTieu.DAL
{
    public static class DBConnectionFactory
    {
        static private IDbConnection dbConnection = null;

        public static IDbConnection GetDbConnection()
        {
            if (dbConnection == null)
            {
                dbConnection = getSQLConnection();
            }

            return dbConnection;
        }

        private static SqlConnection getSQLConnection()
        {
            SqlConnection con = new SqlConnection("Server=.;Database=myDataBase;User Id=sa;Password=123456;");

            return con;
        }
    }
}